package pl.koziolekweb.prusakolep.controllers;

import java.util.Map;

import pl.koziolekweb.prusakolep.utils.Reader;

/**
 * 
 * @author bartlomiejk
 * 
 * 
 * $Id: BasicActionController.java 118 2009-02-17 22:10:52Z bjkuczynski $
 */
public class BasicActionController implements Controller {

	public void action(Map<String, Object> inParams) {
		String msg = "Proszę wybrać operację:\n1 Nowy błąd\n2 Lista błędów\n3 wyjście";
		String controller = "";
		String action = Reader.read(msg);
		ConsoleDispatcher dispatcher = (ConsoleDispatcher) inParams
				.get("Dispatch");

		if ("1".equals(action)) {
			controller = "NewBug";
		} else if ("2".equals(action)) {
			controller = "BugList";
		} else if ("3".equals(action)) {
			controller = "Exit";
		} else {
			return;
		}
		dispatcher.dispatch(controller, null);
	}
}
